#!/bin/bash
# 添加一个http的基础服务
# 比如资源的接受和下载


if [ $UID -ne 0 ]; then
    echo "Superuser privileges are required to run this script."
    echo "e.g. \"sudo $0\""
    exit 1
fi

basepath=$(cd `dirname $0`; cd ../..; pwd)

cd ${basepath}/manager

./initproject.sh httpservice 0

cd ${basepath}/application/httpservice

sed -i -e "s@#{domain}@"${domain}"@g"\
 context.xml.default

cp context.xml.default /home/httpservice/tomcat/conf/Catalina/localhost

cp httpservice.war /home/httpservice/tomcat/webapps/ROOT.war

systemctl stop tomcat_httpservice
systemctl start tomcat_httpservice

